package day015.homework.p1;

import java.util.Comparator;
import java.util.Random;
import java.util.TreeSet;

public class Test2 {
    public static void main(String[] args) {
        Random rand = new Random();
//        TreeSet<Integer> set = new TreeSet<>(new ComparatorImp());
//        for (int i = 0; i < 10; i++) {
//            set.add(rand.nextInt(51));
//        }
//
//        for (Integer num : set) {
//            System.out.print(num + "\t");
//        }
//        System.out.println();

        TreeSet<Integer> set = new TreeSet<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2 - o1;
            }
        });
        for (int i = 0; i < 10; i++) {
            set.add(rand.nextInt(51));
        }

        System.out.println(set);
    }
}
